<?php
namespace app\mxty\model;

use think\Model;
use think\model\concern\SoftDelete;

class TimeFragment extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $table = 'athlon_time_fragment';
    protected $pk = 'time_fragment_id';

    public function parts()
    {
        return $this->belongsToMany(
            ArenaPart::class,
            ArenaPartTimeFragment::class
        );
    }

    public function booked()
    {
        return $this->hasManyThrough(
            Booking::class,
            ArenaPartTimeFragment::class
        );
    }

}
